package utilities.print.menu.execute.main;

import utilities.input.arrangement.LogInit;
import utilities.print.menu.Menu;
import utilities.print.menu.MenuExecute;
import utilities.print.menu.execute.Verify;

import java.io.FileWriter;

import static utilities.print.menu.Menu.line;

public class DeleteLog implements MenuExecute {
    /**
     * 启动菜单功能类方法
     *
     * @throws Exception 可能产生的异常
     */
    @Override
    public void execute() throws Exception {
        System.out.println("正在清理日志中");
        line();
        FileWriter file = new FileWriter(LogInit.logOutputFile,false);
        file.write("");
        file.flush();
        file.close();
        System.out.println("日志已经全部删除!");
        line();
        Verify.pressKey("输入任意内容退出");
    }
}
